 <?php 
if(!empty($model->fullname))
$this->breadcrumbs=array(
	'Nhân vật sự kiện'=>array('index'),
	'Thêm ảnh vào Nhân vật sự kiện',
);
 ?>

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'organizers-form',
	'enableAjaxValidation'=>false,
	'action'=>Yii::app()->createUrl('Events/artists/addimage',array('id'=>$model->id)),
	'clientOptions' => array(
            'validateOnSubmit' => true,
        ),
	'htmlOptions'=>array(
		'class'=>'horizontal-form',
        'enctype'=>'multipart/form-data', 
        // 'multiple' => 'multiple', 
    ),
)); ?>
<div class="form-body row">
	<div class="portlet box green">
		<div class="portlet-title">
		 <div class="caption"><i class="icon-cogs"></i> Thêm ảnh vào nhân vật : <?php echo $model->fullname ; ?></div>
		</div>
	</div>
    <div class="row">
    	<div class="col-md-3">
	            <?php echo $form->labelEx($image,'image'); ?>
		             <!--Show image thumbnail-->
	            <?php 
					$this->widget('CMultiFileUpload', array(
									'name'=>'image',
									//'model' => $image,
					                //'attribute'=>'image',
					                'accept' => 'jpeg|jpg|gif|png', // useful for verifying files
					                'duplicate' => 'Duplicate file!', // useful, i think
					                'denied' => 'Invalid file type', // useful, i think
					                'max'=>10, // max 10 files
					                'remove'=>'[x]',
                        			'htmlOptions' => array( 'multiple' => 'multiple', 'size' => 25 ),
					            ));
	             ?>
	               <?php if(Yii::app()->user->hasFlash('error')): ?>
		                <div class="errorMessage">
		                    <?php echo Yii::app()->user->getFlash('error'); ?>
		                </div>
	                <?php endif; ?>
 		</div>
 
      </div>
</div>
                <?php echo CHtml::submitButton('Create', array('class'=>'btn green', 'style'=>'margin-right : 10px'));?>
                <?php echo CHtml::submitButton('Refresh', array('onClick'=>'window.location="'.Yii::app()->getRequest()->getUrl().'"','class'=>'btn btn-beoro-3','style'=>'margin-right : 10px'));?>
                <?php echo CHtml::link('Back',array('artists/view','id'=>$model->id), array('class'=>'btn green', 'style'=>'margin-right : 10px'));?>
 
   
        <?php $this->endWidget(); ?>
<br>
<div class="row">
	<div class="col-xs-12">
	 <div class="portlet box green">
		<div class="portlet-title">
		 <div class="caption"><i class="icon-cogs"></i>Hình ảnh</div>
		</div>
		     <?php if(!empty($listImage)) foreach ($listImage as $key => $valueImage) { ?>
		    <div class="col-sm-6 col-md-4 row" style="width:290px;margin-right:1px">
		        <div class="thumbnail">
		           <img style="width:100%" src="<?php echo IMAGES_URL . 'Artists/' . $valueImage->image; ?>" alt="<?php echo $model->fullname; ?>" style="" />
		          
		        </div>
		      </div>
		    <?php } ?>
	</div>
  </div>
</div>	